<?php
namespace app\admin\validate;
use think\Validate;

class Admin extends Validate
{
    protected $rule = [
        'username'     => 'require|unique:admin',
    ];

    protected $message = [
        'username.require'     => '姓名不能为空',
        'username.unique'    => '用户名已经存在',
    ];

    /**
     * 验证场景
     * @var \string[][]
     */
    protected $scene = [
        'add'   =>  ['username'],
        'edit'  =>  ['username'],
    ];
}
